import React, { memo } from 'react'
import PropTypes from 'prop-types'
import "./index.scss";

import { getCount } from "@/utils/format-utils";


const WYSongsCover = memo(function (props) {
   const {info} = props; 
   const { picUrl,name,playCount } = info ;
   const imgUrl = picUrl +'?param=140y140'
    return (
        <div className="songs-cover">
        <div className="cover-top">
          <img
            src={imgUrl}
            alt={name}
          />
          <div className="info sprite_covor">
            <span>
              <i className="sprite_icon erji"></i>
              {getCount(playCount) }
            </span>
            <i className="sprite_icon play"></i>
          </div>
        </div>
        <div className="cover-bottom">
          <a href="todo">{name}</a>
        </div>
     
      </div>
    )  
})
WYSongsCover.propTypes = {
  info:PropTypes.object.isRequired
}
WYSongsCover.defaultProps ={
  info:{}
}

export default WYSongsCover